package com.indexingsystem.boss.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.indexingsystem.boss.Vo.IprulesVo;
import com.indexingsystem.boss.Vo.TreeQueryVo;
import com.indexingsystem.boss.entity.Iprules;

public interface IprulesMapper {
	int deleteByPrimaryKey(String ipRuleId);

	int deleteIprulesByIdBatch(@Param("list") List<String> list);

	int insert(Iprules record);

	int insertSelective(Iprules record);

	/**
	 * 获取ip规则总记录数.
	 * 
	 * @return
	 */
	Integer getIpRulesCount(TreeQueryVo treeQueryVo);
	
	/**
	 * 获取最上级机构列表总数量.
	 * 
	 * @return
	 */
	Integer getFirstIpRulesCount();
	
	
	/**
	 * 获取最上级机构列表.
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	List<IprulesVo> getFirstIprulesList(TreeQueryVo treeQueryVo);

	List<IprulesVo> selectIprulesList(TreeQueryVo treeQueryVo);

	IprulesVo selectByPrimaryKey(String ipRuleId);

	Iprules selectByRuleName(String ruleName);

	int updateByPrimaryKeySelective(Iprules record);

	int updateByPrimaryKey(Iprules record);
	
	/**
	 * 通过机构id校验规则名称机构ip段是否重复.
	 * @param institutionsId
	 * @return
	 */
	List<IprulesVo>  queryIprulesByInstitutionsId(String institutionsId);
	
	/**
	 * 根据机构Id查询ip信息
	 * @param ipRuleId
	 * @return
	 */
	Iprules selectByPrimaryIprulesId(String ipRuleId);
	
	
    /**
   * 通过机构id获取机构所属ip规则列表.
   * @param institutionsId
   * @return
   */
  List<Iprules> getIprulesList(String institutionsId);
}